﻿#ifndef IPWIDGET_H
#define IPWIDGET_H

#include <QWidget>

namespace Ui {
class IpWidget;
}
class QSpinBox;
#include <QList>
class IpWidget : public QWidget
{
    Q_OBJECT

public:
    explicit IpWidget(QWidget *parent = nullptr);
    ~IpWidget();
    void setAddress(const QString& ip, int port);

    void setIP(const QString& ip);
    void setPort(int port);

    QString getIP();
    int getPort();
signals:
    void addressChanged(const QString& IP, int port);

private slots:
    void onIPChanged(int i);
private:
    Ui::IpWidget *ui;
    QString m_ip;
    int m_port;
    QList<QSpinBox*> spins;
};

#endif // IPWIDGET_H
